package com.yanqu.road.entity.winery;

import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;

public class ActivityRank {

    private int activityId;

    private long score;

    private String param;

    private final ReadWriteLock scoreLock = new ReentrantReadWriteLock();


    public ActivityRank() {
    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
    }

    public long getScore() {
        this.scoreLock.readLock().lock();
        try {
            return this.score;
        } finally {
            this.scoreLock.readLock().unlock();
        }
    }

    public void setScore(long score) {
        this.score = score;
    }

    public void addScore(long score) {
        this.scoreLock.writeLock().lock();
        try {
            this.score += score;
        } finally {
            this.scoreLock.writeLock().unlock();
        }
    }

    public String getParam() {
        return param;
    }

    public void setParam(String param) {
        this.param = param;
    }


}
